 <?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
 <link href="<?= STATICURL; ?>css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/font-awesome.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/weather-icons.min.css" rel="stylesheet" />
    <!--Fonts-->
    <!--Beyond styles-->
    <link id="beyond-link" href="<?= STATICURL; ?>css/beyond.min.css" rel="stylesheet" type="text/css" />
    <link href="<?= STATICURL; ?>css/demo.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/typicons.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/animate.min.css" rel="stylesheet" />
    <link id="skin-link" href="" rel="stylesheet" type="text/css" />
    <style type="text/css">
    input[type="checkbox"], input[type="radio"] {
    cursor: pointer;
    height: 18px;
    left: -9999px;
    opacity: 1;
    position: static;
    width: 18px;
    z-index: 12;
}
</style>
    <div class="page-content">
         <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="#">首页</a>
                        </li>
                        <li class="">
                            <a href="#">会员</a>
                        </li>
                    </ul>
                </div>
                <div class="page-body">
                    <div class="page-body">
                            <div class="row">
                                <div class="col-lg-12 col-sm-12 col-xs-12">
                                    <div class="row">
                                        <div class="col-lg-12 col-sm-12 col-xs-12">
                                            <div class="row">
                                                <div class="col-lg-12 col-sm-12 col-xs-12">
                                                    <div class="widget flat radius-bordered">
                                                        <div class="widget-body">
                                                            <div id="registration-form">
                                                                    <div class="row">
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <span class="input-icon icon-right">
                                                                                    <input type="text" class="form-control" id="truename" placeholder="用户姓名">
                                                                                    <i class="glyphicon glyphicon-user circular"></i>
                                                                                </span>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <input name="sex" type="radio" checked="checked" value="1"> 男
                                                                                <input name="sex" type="radio" value="2">女
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                     <div class="row">
                                                                        
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <select id="department">
                                                                                    <option value="0">-----所附科室----</option>
                                                                                    <?php foreach($departmentList as $k=>$v):?>   
                                                                                            <option <?php if($NewsInfo['cat_id'] == $v['id']):?>selected<?php endif;?> value="<?=$v['id']?>">
                                                                                                <?=$v['name']?>
                                                                                            </option>                                                                   
                                                                                    <?php endforeach;?>                                                                 
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row">
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <span class="input-icon icon-right">
                                                                                    <input type="text" class="form-control" id="zhuanye" placeholder="专业">
                                                                                </span>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <span class="input-icon icon-right">
                                                                                    <input type="text" class="form-control" id="zhicheng" placeholder="职称">
                                                                                    
                                                                                </span>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="row">
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <span class="input-icon icon-right">
                                                                                    <input type="text" class="form-control" id="qq" placeholder="QQ">
                                                                                </span>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <span class="input-icon icon-right">
                                                                                    <input type="text" class="form-control" id="mobile" placeholder="手机">
                                                                                    
                                                                                </span>
                                                                            </div>
                                                                        </div>
                                                                    </div>


                                                                   
                                                                    <div class="row">
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <span class="input-icon icon-right">
                                                                                    <input type="text" class="form-control" id="username" placeholder="账号名称">
                                                                                    <i class="fa fa-envelope-o circular"></i>
                                                                                </span>
                                                                            </div>
                                                                        </div>
                                                                        <div class="col-sm-6">
                                                                            <div class="form-group">
                                                                                <span class="input-icon icon-right">
                                                                                    <input type="text" class="form-control" id="password" placeholder="密码">
                                                                                    <i class="fa fa-lock circular"></i>
                                                                                </span>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <hr class="wide" />
                                                                    <button id="editUser"  class="btn btn-blue">提交</button>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                               
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                </div>
        <input type="hidden" id="idpalce" value="<?php echo $NewsInfo['newsID']?>" />
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script src="<?php echo STATICURL; ?>layer/layer.js"></script>
<script>
    $(document).ready(function() {
        $("#editUser").click(function(){
            var truename = $("#truename").val();
            var username = $("#username").val();
            var zhuanye = $("#zhuanye").val();
            var zhicheng = $("#zhicheng").val();
            var qq = $("#qq").val();
            var mobile = $("#mobile").val();
            var sex = $('input:radio[name="sex"]:checked').val();;
            var departmentid = $("#department").val();
            var password = $("#password").val();
            var AccountID = "<?=$userInfo['AccountID']?>";
            if(truename == ""){
                layer.msg("用户姓名不能为空！");return false;
            }
            if(departmentid == 0){
                layer.msg("请选择所属科室！");return false;   
            }
            if(!zhuanye){
                layer.msg("专业不能为空！");return false;   
            }
            if(!zhicheng){
                layer.msg("职称不能为空！");return false;   
            }
            if(!mobile){
                layer.msg("手机号码不能为空！");return false;   
            }
            if(username == ""){
                layer.msg("账号名称不能为空！");return false;   
            }
            if(password == ""){
                layer.msg("账号密码不能为空！");return false;   
            }
            
	    $.post("<?=BASEURL?>luckydog/user/editUser", {zhuanye:zhuanye,zhicheng:zhicheng,qq:qq,mobile:mobile,sex:sex,"truename":truename,"username":username,"departmentid":departmentid,"password":password,"AccountID":AccountID}, function(res) {
                if (res) {
                    layer.msg("成功");
                    window.location.href="/luckydog/user/index";
                }else{
                    layer.msg("失败");
                }
            });
        });
    });
</script>


